package es.upm.gib.mappingAPI2;

import java.io.Serializable;

/**
 * This class contains the information of the database of the project
 * This class has some possible fields:
 * - Name of the database
 * - Description about the database
 * - URL of the database
 * - Id of the database
 * - User of the database
 * - Password of the database
 * 
 */
public class DatabaseInfo implements Serializable{

    //=======================================================================
    //ATTRIBUTES
    //=======================================================================

    /**
     * Name of the database
     */
    private String dbName;

    /**
     * A free text description of the database
     */
    private String dbDescription;

    /**
     * url (if any) where the database is available
     */
    private String dbUrl;

    /**
     * Identifier for accessing (if any) this database.
     */
    private String dbId;

    /**
     * User value for accessing this database, if needed
     */
    private String dbUsr;

    /**
     * password value for accessing this database, if needed
     */
    private String dbPsw;


    //=======================================================================
    // CONSTRUCTORS
    //=======================================================================

    /**
     * Constructor
     */
    public DatabaseInfo() {
    }

    /**
     * Constructor
     *
     * @param dbName name of the database
     */
    public DatabaseInfo(String dbName) {
        this.dbName = dbName;
    }

    /**
     *
     * @param dbName database name
     * @param dbDescription database description
     * @param dbUrl database URL
     * @param dbId database Identifier
     * @param dbUsr database user
     * @param dbPsw database password
     */
    public DatabaseInfo(String dbName, String dbDescription, String dbUrl, String dbId, String dbUsr, String dbPsw){
        this.dbName = dbName;
        this.dbDescription = dbDescription;
        this.dbUrl = dbUrl;
        this.dbId = dbId;
        this.dbUsr = dbUsr;
        this.dbPsw = dbPsw;
    }

    //=======================================================================
    // PUBLIC METHODS
    //=======================================================================

    /**
     * Retrieves the name of the database
     *
     * @return name of data base
     */
    public String getDbName() {
        return dbName;
    }

    /**
     * Set the name of the data base
     *
     * @param dbName Name of the database
     */
    public void setDbName(String dbName) {
        this.dbName = dbName;
    }

    /**
     * Retrieves the description of the database
     *
     * @return description of database
     */
    public String getDbDescription() {
        return dbDescription;
    }

    /**
     * Set a description of the database
     *
     * @param dbDescription description of the database
     */
    public void setDbDescription(String dbDescription) {
        this.dbDescription = dbDescription;
    }

    /**
     * Retrieves the url of the database
     *
     * @return Url of the database
     */
    public String getDbUrl() {
        return dbUrl;
    }

    /**
     * Set Url of the database
     *
     * @param dbUrl Url of the database
     */
    public void setDbUrl(String dbUrl) {
        this.dbUrl = dbUrl;
    }

    /**
     * Retrieves identifier of the database
     *
     * @return database id
     */
    public String getDbId() {
        return dbId;
    }

    /**
     * Set a identifier to the database
     *
     * @param dbId identifier
     */
    public void setDbId(String dbId) {
        this.dbId = dbId;
    }

    /**
     * Retrieves name of the user of the database
     *
     * @return user name of the database
     */
    public String getDbUsr() {
        return dbUsr;
    }

    /**
     * Set an user name to the database
     *
     * @param dbUsr user name of database
     */
    public void setDbUsr(String dbUsr) {
        this.dbUsr = dbUsr;
    }

    /**
     * Retrieves the password of the database
     *
     * @return database password
     */
    public String getDbPsw() {
        return dbPsw;
    }

    /**
     * Set a password to the database
     *
     * @param dbPsw password of the database
     */
    public void setDbPsw(String dbPsw) {
        this.dbPsw = dbPsw;
    }

}
